package factory.simpleFactory

/**
 * 简单工厂
 */
class LoginFactory {
    enum class LoginType {
        QQ, WE_CHART, ACCOUNT
    }

    companion object {
        fun create(loginType: LoginType): Login {
            return when (loginType) {
                LoginType.QQ -> QQLogin()
                LoginType.WE_CHART -> WeChartLogin()
                LoginType.ACCOUNT -> AccountLogin()
            }
        }
    }
}